﻿using System;
using RockCorn.Internals;

namespace RockCorn.Objects.Moving
{
    class Gift : MovingObject
    {
        public new const string CollisionGroupString = "gift";
        private int step = 0;

        public Gift(MatrixCoords topLeft)
            : base(topLeft, new char[,] { { '+' } }, new MatrixCoords(1, 0))
        {
        }

        public override int GetPoints()
        {
            return 25;
        }

        protected override void UpdatePosition()
        {
            ++this.step;
            if(this.step%2==0)
            this.TopLeft += this.Speed;
        }

        public override bool CanCollideWith(string otherCollisionGroupString)
        {
            return otherCollisionGroupString.Contains("racket") || otherCollisionGroupString.Contains("bullet");
        }

        public override string GetCollisionGroupString()
        {
            return Gift.CollisionGroupString;
        }

        public override void RespondToCollision(CollisionData collisionData)
        {
            this.IsDestroyed = true;
        }
    }
}
